package com.example.a2022application;

import androidx.appcompat.app.AppCompatActivity;

import android.app.AlertDialog;
import android.content.DialogInterface;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;

import com.example.a2022application.activity.AddTeacherActivity;
import com.example.a2022application.activity.AddTimeTableActivity;
import com.example.a2022application.activity.CreateClassActivity;
import com.example.a2022application.activity.WorkActivity;
import com.example.a2022application.utils.SpUtils;

public class login_administrator extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_administrator_login);
    }
    public void one(View view){
        startActivity(new Intent(login_administrator.this, AddTimeTableActivity.class));
    }
    public void two(View view){
        startActivity(new Intent(login_administrator.this, WorkActivity.class));
    }
    public void three(View view){
        startActivity(new Intent(login_administrator.this, CreateClassActivity.class));
    }
    //退出
    public void exit(View view){
        new AlertDialog.Builder(this)
                .setTitle("确定退出登录？")
                .setPositiveButton("确定", new DialogInterface.OnClickListener() {
                    @Override
                    public void onClick(DialogInterface dialogInterface, int i) {
                        SpUtils.clear(login_administrator.this);
                        startActivity(new Intent(login_administrator.this, MainActivity.class));
                        finish();
                    }

                })
                .setNegativeButton("取消", null)
                .show();
    }
}